<div class="x-body">
    <form class="layui-form" data-form='{:request()->url()}'>

        <div class="layui-form-item">
            <label for="title" class="layui-form-label">
                <span class="x-red">*</span>菜单名称
            </label>
            <div class="layui-input-block">
                <input type="text" id="title" name="title" required="" lay-verify="required"
                       value="{$vo.title|default=''}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="title" class="layui-form-label">
                <span class="x-red">*</span>排序
            </label>
            <div class="layui-input-inline">
                <input type="text" id="sort" name="sort" required="" lay-verify="required"
                       value="{$vo.sort|default='50'}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>影响菜单顺序
            </div>
        </div>

        <div class="layui-form-item">
            <label for="pid" class="layui-form-label">
                <span class="x-red">*</span>上级菜单
            </label>
            <div class="layui-input-block">
                <select name="pid" id="pid" lay-verify="required">
                    <option value="0">顶级菜单</option>
                    {volist name="parents" id="parent"}
                    <option value="{$parent.id}" {if ((isset($vo.pid)) AND ($vo.pid eq $parent.id)) OR (isset($pid) AND ($pid eq $parent.id)) }selected{/if}>
                    {$parent._pre}{$parent.title}
                    </option>
                    {/volist}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="url" class="layui-form-label">
                <span class="x-red">*</span>链接地址
            </label>
            <div class="layui-input-block">
                <input type="text" value="{$vo.url|default='#'}" id="url" name="url" required=""
                       class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input name="icon" value="">
        </div>

        <div class="layui-form-item layui-col-xs10 layui-col-xs-offset2">
            {if isset($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" lay-filter="add" lay-submit="">
                确定
            </button>
        </div>
    </form>
</div>
<script>
    layui.form.render();
</script>